* {
    margin: 0;
    padding: 0;
}
body {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.search-btn {
    position: relative;
    z-index: 1;
    width: 60px;
    height: 60px;
    line-height: 60px;
    text-align: center;
    transition: 0.8s;
    cursor: pointer;
    .fa {
        color: #fff;
        font-size: 22px;
    }
}
.close-btn {
    position: absolute;
    top: 25px;
    right: 25px;
    z-index: 1;
    font-size: 25px;
    color: #fff;
    cursor: pointer;
    display: none;
}
// 搜索框最外面的背景，为展开后最大的紫色背景
.container {
    position: fixed;
    width: 100%;
    height: 100%;
    /* 弹性布局 */
    display: flex;
    justify-content: center;
    align-items: center;
    /* 渐变背景 */
    background: linear-gradient(200deg, #6e86ee, #453c90);
    clip-path: circle(30px at 50% 50%);
    transition: 0.4s;
    .search-box {
        //搜索框主体
        width: 0;
        height: 50px;
        display: flex;
        border-bottom: 3px solid #fff;
        overflow: hidden;
        transition: 0.3s;

        input {
            width: 100%;
            height: 50px;
            border: none;
            outline: none;
            background: none;
            color: #fff;
            font-size: 22px;
            text-indent: 8px;
            &::placeholder {
                color: rgba(255, 255, 255, 0.7);
            }
        }
        .fa {
            width: 50px;
            height: 50px;
            // 设置行高，就能够垂直居中了，聪明的做法
            line-height: 50px;
            // 水平居中
            text-align: center;
            color: #fff;
            font-size: 22px;
            cursor: pointer;
        }
    }
}
#search_btn:checked {
    ~ .search-btn {
        opacity: 0;
        transition: 0s;
    }
    ~ .close-btn {
        display: block;
    }
    ~ .container {
        clip-path: circle(100%);
        .search-box {
            width: 400px;
        }
    }
}
